package edu.scsu.csci.converter;

import edu.scsu.csci.IConverter;


/**
 *
 * @author Maqbool Khan
 * @since jdk 1.5
 * @see
 * @viz.diagram SimpleByteConverter.tpx
 */
final public class SimpleByteConverter implements IConverter<Byte> {

	/**
	 * @see edu.scsu.csci.IConverter#convert(java.lang.String, java.lang.Class)
	 */
	public Byte convert(String value, Class<?> type)
			throws ConversionException {
		if (value == null || value.equals("")) {
			return null;
		}
		try {
			return Byte.valueOf(value);
		} catch (Exception e) {
			throw new ConversionException("Illegal value.");
		}
	}

}
